const express=require('express')

const mongoose=require('mongoose')



const app=express()
mongoose.connect('mongodb://localhost/playing',{
    useNewUrlParser: true,
    useUnifiedTopology: true
}).then(res=>{
    console.log('连接数据库成功')
}).catch(err=>{
    console.log('连接数据库失败')
})

const CourseSher=new mongoose.Schema({
    name:String,
    age:Number
})


const sheets=mongoose.model('zsSheets',CourseSher)


const myZs=new sheets({
    name:'zs',
    age:1
})


myZs.save()


app.listen(3000,()=>{
    console.log('3000启动')
})





